#include <bits/stdc++.h>
using namespace std;
map <char,int> m1;
map<char,int> m2;
int fun(int x)
{
    int res=0;
    if(x<=10)return x*500;
    if(x<=30)return 5000+(x-10)*800;
    if(x<=60) return fun(30)+(x-30)*1000;
    if(x<=100)return fun(60)+(x-60)*1500;
    return fun(100)+(x-100)*2000;
}
int main()
{
    m1['A']=60;
    m1['B']=35;
    m1['C']=20;
    m1['D']=85;

    for(auto x:m1)
    {
        m2[x.first]=fun(x.second);
    }
    for(auto x:m2)
    {
        cout<<x.first<<" "<<x.second<<endl;
    }
   
   return 0;
}
